
/*
 * 导出用户.
 * @param {Object} prefix
 */
function exportUsers(prefix){
	
	var str="";
	var checkArray = document.getElementsByName("chk");
	for (var i = 0; i < checkArray.length; i++) {
		if(checkArray[i].checked){
			str += checkArray[i].value + ",";
		}
	}
	var dot = str.lastIndexOf(",");
	if(dot==-1){
		layer.alert("请选择要导出的用户。");
		return;
	}else{
		str = str.substring(0,dot);
	}
	
	layer.confirm("确认导出？", function(){
		var url=prefix+"/report/exportUser";
		$.post(url,{"idStr":str,},function(data){
			layer.msg(data.message, 1, 1, function(){
				if(data.result=="OK"){
					location.href = location.href;
				}
			});
		},'json');
	});	
}

/*
 * 设置为已导出状态.
 * @param {Object} prefix
 */
function setExportFlag(prefix){
	
	var str="";
	var checkArray = document.getElementsByName("chk");
	for (var i = 0; i < checkArray.length; i++) {
		if(checkArray[i].checked){
			str += checkArray[i].value + ",";
		}
	}
	var dot = str.lastIndexOf(",");
	if(dot==-1){
		layer.alert("请选择要设置状态的用户。");
		return;
	}else{
		str = str.substring(0,dot);
	}

	layer.confirm("确认执行？", function(){
		var url=prefix+"/report/exportOverUser";
		$.post(url,{"idStr":str,},function(data){
			layer.msg(data.message, 1, 1, function(){
				if(data.result=="OK"){
					location.href = location.href;
				}
			});
		},'json');
	});	
}